#ifndef __PLUG_MEDIA_AO_H__
#define __PLUG_MEDIA_AO_H__

#include "hi_type.h"
#include "mpp_help.h"

#include "sample_comm.h"
#include "acodec.h"
#include "audio_aac_adp.h"
#include "audio_dl_adp.h"
#include "audio_mp3_adp.h"

#include "hi_resampler_api.h"
#include "plug_common.h"


#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

#define PLUG_MEDIA_SOUND_PATH "/hiopenais/audio"

#define AO_CHNN          0

#define AD_CHNN          0
#define AO_DEV           0

typedef struct tagPLUG_AO_STREAM_S {
    HI_U8* pStream;                   /* the virtual address of stream */
    HI_U32 u32Len;                    /* stream lenth, by bytes */
    HI_U64 u64TimeStamp;              /* frame time stamp */
}PLUG_AO_STREAM_S;

typedef enum tagPLUG_MEDIA_AO_SOUND_E
{
    PLUG_MEDIA_AO_SOUND_HEAD = 0,
#if (defined(HI_COMM_AI_ADAPT_DOOR))
    PLUG_MEDIA_AO_SOUND_TEMPERATURE,        /* 温度过高报警音 */
    PLUG_MEDIA_AO_SOUND_HUMIDITY,           /* 湿度过高报警音 */
    PLUG_MEDIA_AO_SOUND_SMOKE,              /* 检测到有烟报警 */
#elif (defined(HI_COMM_AI_ADAPT_GESTURE))

#elif (defined(HI_COMM_AI_ADAPT_GUIDER))
    PLUG_MEDIA_AO_SOUND_DISTANCE_AHEAD,     /* 检测到前方有障碍物 */
    PLUG_MEDIA_AO_SOUND_DISTANCE_BELOW,     /* 检测到下方有障碍物 */
    PLUG_MEDIA_AO_SOUND_DISTANCE_BELOW_PIT, /* 检测到下方有坑 */
#endif
    PLUG_MEDIA_AO_SOUND_PHOTO,              /* 拍照 */
    PLUG_MEDIA_AO_SOUND_START_RECODE,       /* 开始录像 */
    PLUG_MEDIA_AO_SOUND_STOP_RECODE,        /* 停止录像 */
    PLUG_MEDIA_AO_SOUND_MUSIC,              /* 音乐播放 */

    PLUG_MEDIA_AO_SOUND_BUTT
}PLUG_MEDIA_AO_SOUND_E;


/**
 * @brief    plug media ao init.
 * @param[in] enAdecType adec decode type
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MEDIA_AO_Init(PAYLOAD_TYPE_E enAdecType);

/**
 * @brief    plug system sound.
 * @param[in] enType: sound type
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MEDIA_AO_SystemSound(PLUG_MEDIA_AO_SOUND_E enType);

/**
 * @brief    plug ao play talk sound.
 * @param[in] pTalkData: talk data struct
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MEDIA_AO_TalkSound(PLUG_AO_STREAM_S* pTalkData);

/**
 * @brief    plug ao play talk sound.
 * @param[in] bSysSoundRet: system sound
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MEDIA_AO_SetSysSound(HI_BOOL bSysSoundRet);

/**
 * @brief    plug media ao deinit.
 * @param[in] none
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MEDIA_AO_Deinit(HI_VOID);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif
